package com.htudata.transctLive.controller;

import javax.servlet.http.HttpServletRequest;

import com.htudata.common.enums.RequestSeqEnum;
import com.htudata.common.enums.RequestStatusEnum;
import com.htudata.common.vo.ResponseResult;
import com.htudata.core.util.ResultGenerator;
import com.htudata.live.service.VirtualStationService;
import com.htudata.transctLive.service.TransctLiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TransctLiveController {

  @Autowired
  private TransctLiveService liveService;
  
  @Autowired
  private VirtualStationService virtualStationService;
  
  @Autowired
  private HttpServletRequest request;
  
  @RequestMapping(value = {"/v1/live/transct/flowsMgt/{flowId}"}, method = {RequestMethod.GET})
  public ResponseResult get3DFlows(@PathVariable String flowId, @RequestParam(required = true) String a2) {
    try {
      return ResultGenerator.genResult(RequestSeqEnum.SEQ_004.getCode(), this.liveService
          .get3DFlowList(flowId, a2), "获取3D流程图数据成功");
    } catch (Exception e) {
      log.error("get3DFlows",e);
      return ResultGenerator.genErrorResult(RequestSeqEnum.SEQ_004.getCode(), RequestStatusEnum.STATUS_503
          .getCode(), "暂无数据");
    } 
  }
}
